package a_java_48_day.day1;

import java.util.*;
public class Main1 {
    public static void main(String[] args) {
        List<Long> list=new ArrayList<>();
        Scanner sc = new Scanner(System.in);
        int n=sc.nextInt();
        long ans=0;
        long a_i=0;
        for(int i=0;i<3*n;i++){
            a_i=sc.nextLong();
            list.add(a_i);
        }
        Collections.sort(list);
        for(int j=n;j<3*n;j=j+2){
            ans+=list.get(j);
        }
        System.out.println(ans);
    }
}
